package com.quick.proxy.server.handler.visitor;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * Description: 接收数据时解码
 * Author: 吃素不吃肉
 * Date: 2023/7/9
 *
 * @author 吃素不吃肉
 */
@Slf4j
public class VisitorProxyServerProtocolDecoder extends ByteToMessageDecoder {
    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) {
        byte[] decodeBytes = new byte[byteBuf.readableBytes()];
        byteBuf.readBytes(decodeBytes);
        list.add(decodeBytes);
    }
}
